<template>
    <div class="pay-done-box ">
        <img src="https://www.hjplayer.cn/shopwe_old/images/payok.png">
        <p>支付成功</p>
    </div>
</template>

<script>
    import {paySuccess} from '../../../api/pay'

    export default {
        name: "paySuccess",
        data() {
            return {
                orderId: localStorage.getItem("orderId")
            }
        },
        created() {
            this.toOrder();
        },
        methods: {
            toOrder() {
                paySuccess(this.orderId).then(res => {
                    setTimeout(() => {
                        localStorage.removeItem("orderId")
                        this.$router.push({path: '/order'})
                    }, 1500)
                })
            }
        }
    }
</script>

<style scoped>
    .pay-done-box {
        height: 600px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        font-size: 25px;
    }
</style>
